using Microsoft.VisualBasic;
using Microsoft.VisualBasic.CompilerServices;
using SJVars;
using Spacejock;
using System;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Windows.Forms;
using yW5Lib;
using yWriter6.My.Resources;

namespace yWriter6
{
	[DesignerGenerated]
	public class frmList : Form
	{
		private IContainer components;

		public ToolTip ToolTip1;

		[CompilerGenerated]
		[AccessedThroughProperty("ToolStrip2")]
		private ToolStrip _ToolStrip2;

		[CompilerGenerated]
		[AccessedThroughProperty("tsbAdd")]
		private ToolStripButton _tsbAdd;

		[CompilerGenerated]
		[AccessedThroughProperty("tsbEdit")]
		private ToolStripButton _tsbEdit;

		[CompilerGenerated]
		[AccessedThroughProperty("tsbDel")]
		private ToolStripButton _tsbDel;

		[CompilerGenerated]
		[AccessedThroughProperty("ToolStripSeparator4")]
		private ToolStripSeparator _ToolStripSeparator4;

		[CompilerGenerated]
		[AccessedThroughProperty("tsbPrintList")]
		private ToolStripButton _tsbPrintList;

		[CompilerGenerated]
		[AccessedThroughProperty("cmdCancel")]
		private Button _cmdCancel;

		[CompilerGenerated]
		[AccessedThroughProperty("chkOnlyMajor")]
		private CheckBox _chkOnlyMajor;

		[CompilerGenerated]
		[AccessedThroughProperty("cmdOK")]
		private Button _cmdOK;

		[CompilerGenerated]
		[AccessedThroughProperty("ListItems")]
		private ListView _ListItems;

		[CompilerGenerated]
		[AccessedThroughProperty("ColShortName")]
		private ColumnHeader _ColShortName;

		[CompilerGenerated]
		[AccessedThroughProperty("colFullName")]
		private ColumnHeader _colFullName;

		[CompilerGenerated]
		[AccessedThroughProperty("BottomToolStripPanel")]
		private ToolStripPanel _BottomToolStripPanel;

		[CompilerGenerated]
		[AccessedThroughProperty("TopToolStripPanel")]
		private ToolStripPanel _TopToolStripPanel;

		[CompilerGenerated]
		[AccessedThroughProperty("RightToolStripPanel")]
		private ToolStripPanel _RightToolStripPanel;

		[CompilerGenerated]
		[AccessedThroughProperty("LeftToolStripPanel")]
		private ToolStripPanel _LeftToolStripPanel;

		[CompilerGenerated]
		[AccessedThroughProperty("ContentPanel")]
		private ToolStripContentPanel _ContentPanel;

		[CompilerGenerated]
		[AccessedThroughProperty("Panel2")]
		private Panel _Panel2;

		[CompilerGenerated]
		[AccessedThroughProperty("Panel3")]
		private Panel _Panel3;

		[CompilerGenerated]
		[AccessedThroughProperty("tsbLocations")]
		private ToolStripButton _tsbLocations;

		[CompilerGenerated]
		[AccessedThroughProperty("tsbChar")]
		private ToolStripButton _tsbChar;

		[CompilerGenerated]
		[AccessedThroughProperty("tsbItems")]
		private ToolStripButton _tsbItems;

		[CompilerGenerated]
		[AccessedThroughProperty("tsbSep")]
		private ToolStripSeparator _tsbSep;

		[CompilerGenerated]
		[AccessedThroughProperty("StatusStrip1")]
		private StatusStrip _StatusStrip1;

		[CompilerGenerated]
		[AccessedThroughProperty("tssStatus")]
		private ToolStripStatusLabel _tssStatus;

		[CompilerGenerated]
		[AccessedThroughProperty("tsbHelp")]
		private ToolStripButton _tsbHelp;

		[CompilerGenerated]
		[AccessedThroughProperty("ToolStripSeparator1")]
		private ToolStripSeparator _ToolStripSeparator1;

		[CompilerGenerated]
		[AccessedThroughProperty("colExtra")]
		private ColumnHeader _colExtra;

		[CompilerGenerated]
		[AccessedThroughProperty("ContextMenuStrip1")]
		private ContextMenuStrip _ContextMenuStrip1;

		[CompilerGenerated]
		[AccessedThroughProperty("SortToolStripMenuItem")]
		private ToolStripMenuItem _SortToolStripMenuItem;

		[CompilerGenerated]
		[AccessedThroughProperty("tsmTB")]
		private ToolStripTextBox _tsmTB;

		[CompilerGenerated]
		[AccessedThroughProperty("tsbFind")]
		private ToolStripButton _tsbFind;

		[CompilerGenerated]
		[AccessedThroughProperty("tsbClear")]
		private ToolStripButton _tsbClear;

		public bool Cancelled;

		private clsFillList cFill;

		private bool SuppressChange;

		private eRecord eType;

		private bool SuspendRedraw;

		private bool OnlyMajor;

		private clsProject cProject;

		private Rectangle HighlightedItem;

		[CompilerGenerated]
		[AccessedThroughProperty("cPrLoc")]
		private clsPrintLocationList _cPrLoc;

		[CompilerGenerated]
		[AccessedThroughProperty("cPrItem")]
		private clsPrintItemList _cPrItem;

		[CompilerGenerated]
		[AccessedThroughProperty("cPrChar")]
		private clsPrintCharList _cPrChar;

		[field: AccessedThroughProperty("ToolStrip2")]
		internal virtual ToolStrip ToolStrip2
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual ToolStripButton tsbAdd
		{
			[CompilerGenerated]
			get
			{
				return _tsbAdd;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = tsbAdd_Click;
				ToolStripButton tsbAdd = _tsbAdd;
				if (tsbAdd != null)
				{
					tsbAdd.Click -= value2;
				}
				_tsbAdd = value;
				tsbAdd = _tsbAdd;
				if (tsbAdd != null)
				{
					tsbAdd.Click += value2;
				}
			}
		}

		internal virtual ToolStripButton tsbEdit
		{
			[CompilerGenerated]
			get
			{
				return _tsbEdit;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = tsbEdit_Click;
				ToolStripButton tsbEdit = _tsbEdit;
				if (tsbEdit != null)
				{
					tsbEdit.Click -= value2;
				}
				_tsbEdit = value;
				tsbEdit = _tsbEdit;
				if (tsbEdit != null)
				{
					tsbEdit.Click += value2;
				}
			}
		}

		internal virtual ToolStripButton tsbDel
		{
			[CompilerGenerated]
			get
			{
				return _tsbDel;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = tsbDel_Click;
				ToolStripButton tsbDel = _tsbDel;
				if (tsbDel != null)
				{
					tsbDel.Click -= value2;
				}
				_tsbDel = value;
				tsbDel = _tsbDel;
				if (tsbDel != null)
				{
					tsbDel.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("ToolStripSeparator4")]
		internal virtual ToolStripSeparator ToolStripSeparator4
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual ToolStripButton tsbPrintList
		{
			[CompilerGenerated]
			get
			{
				return _tsbPrintList;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = tsbPrintList_Click;
				ToolStripButton tsbPrintList = _tsbPrintList;
				if (tsbPrintList != null)
				{
					tsbPrintList.Click -= value2;
				}
				_tsbPrintList = value;
				tsbPrintList = _tsbPrintList;
				if (tsbPrintList != null)
				{
					tsbPrintList.Click += value2;
				}
			}
		}

		public virtual Button cmdCancel
		{
			[CompilerGenerated]
			get
			{
				return _cmdCancel;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmdCancel_Click;
				Button cmdCancel = _cmdCancel;
				if (cmdCancel != null)
				{
					cmdCancel.Click -= value2;
				}
				_cmdCancel = value;
				cmdCancel = _cmdCancel;
				if (cmdCancel != null)
				{
					cmdCancel.Click += value2;
				}
			}
		}

		public virtual CheckBox chkOnlyMajor
		{
			[CompilerGenerated]
			get
			{
				return _chkOnlyMajor;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = chkOnlyMajor_CheckStateChanged;
				CheckBox chkOnlyMajor = _chkOnlyMajor;
				if (chkOnlyMajor != null)
				{
					chkOnlyMajor.CheckStateChanged -= value2;
				}
				_chkOnlyMajor = value;
				chkOnlyMajor = _chkOnlyMajor;
				if (chkOnlyMajor != null)
				{
					chkOnlyMajor.CheckStateChanged += value2;
				}
			}
		}

		public virtual Button cmdOK
		{
			[CompilerGenerated]
			get
			{
				return _cmdOK;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = cmdOK_Click;
				Button cmdOK = _cmdOK;
				if (cmdOK != null)
				{
					cmdOK.Click -= value2;
				}
				_cmdOK = value;
				cmdOK = _cmdOK;
				if (cmdOK != null)
				{
					cmdOK.Click += value2;
				}
			}
		}

		public virtual ListView ListItems
		{
			[CompilerGenerated]
			get
			{
				return _ListItems;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = ListItems_DoubleClick;
				DragEventHandler value3 = ListItems_DragDrop;
				EventHandler value4 = ListItems_DragLeave;
				DragEventHandler value5 = ListItems_DragOver;
				ItemDragEventHandler value6 = ListItems_ItemDrag;
				EventHandler value7 = ListItems_SelectedIndexChanged;
				ListView listItems = _ListItems;
				if (listItems != null)
				{
					listItems.DoubleClick -= value2;
					listItems.DragDrop -= value3;
					listItems.DragLeave -= value4;
					listItems.DragOver -= value5;
					listItems.ItemDrag -= value6;
					listItems.SelectedIndexChanged -= value7;
				}
				_ListItems = value;
				listItems = _ListItems;
				if (listItems != null)
				{
					listItems.DoubleClick += value2;
					listItems.DragDrop += value3;
					listItems.DragLeave += value4;
					listItems.DragOver += value5;
					listItems.ItemDrag += value6;
					listItems.SelectedIndexChanged += value7;
				}
			}
		}

		[field: AccessedThroughProperty("ColShortName")]
		public virtual ColumnHeader ColShortName
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("colFullName")]
		public virtual ColumnHeader colFullName
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("BottomToolStripPanel")]
		internal virtual ToolStripPanel BottomToolStripPanel
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("TopToolStripPanel")]
		internal virtual ToolStripPanel TopToolStripPanel
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("RightToolStripPanel")]
		internal virtual ToolStripPanel RightToolStripPanel
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("LeftToolStripPanel")]
		internal virtual ToolStripPanel LeftToolStripPanel
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("ContentPanel")]
		internal virtual ToolStripContentPanel ContentPanel
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("Panel2")]
		internal virtual Panel Panel2
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("Panel3")]
		internal virtual Panel Panel3
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual ToolStripButton tsbLocations
		{
			[CompilerGenerated]
			get
			{
				return _tsbLocations;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = tsbLoc_Click;
				ToolStripButton tsbLocations = _tsbLocations;
				if (tsbLocations != null)
				{
					tsbLocations.Click -= value2;
				}
				_tsbLocations = value;
				tsbLocations = _tsbLocations;
				if (tsbLocations != null)
				{
					tsbLocations.Click += value2;
				}
			}
		}

		internal virtual ToolStripButton tsbChar
		{
			[CompilerGenerated]
			get
			{
				return _tsbChar;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = tsbChar_Click;
				ToolStripButton tsbChar = _tsbChar;
				if (tsbChar != null)
				{
					tsbChar.Click -= value2;
				}
				_tsbChar = value;
				tsbChar = _tsbChar;
				if (tsbChar != null)
				{
					tsbChar.Click += value2;
				}
			}
		}

		internal virtual ToolStripButton tsbItems
		{
			[CompilerGenerated]
			get
			{
				return _tsbItems;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = tsbItems_Click;
				ToolStripButton tsbItems = _tsbItems;
				if (tsbItems != null)
				{
					tsbItems.Click -= value2;
				}
				_tsbItems = value;
				tsbItems = _tsbItems;
				if (tsbItems != null)
				{
					tsbItems.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("tsbSep")]
		internal virtual ToolStripSeparator tsbSep
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("StatusStrip1")]
		internal virtual StatusStrip StatusStrip1
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("tssStatus")]
		internal virtual ToolStripStatusLabel tssStatus
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual ToolStripButton tsbHelp
		{
			[CompilerGenerated]
			get
			{
				return _tsbHelp;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = tsbHelp_Click;
				ToolStripButton tsbHelp = _tsbHelp;
				if (tsbHelp != null)
				{
					tsbHelp.Click -= value2;
				}
				_tsbHelp = value;
				tsbHelp = _tsbHelp;
				if (tsbHelp != null)
				{
					tsbHelp.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("ToolStripSeparator1")]
		internal virtual ToolStripSeparator ToolStripSeparator1
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		[field: AccessedThroughProperty("colExtra")]
		internal virtual ColumnHeader colExtra
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual ContextMenuStrip ContextMenuStrip1
		{
			[CompilerGenerated]
			get
			{
				return _ContextMenuStrip1;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				CancelEventHandler value2 = ContextMenuStrip1_Opening;
				ContextMenuStrip contextMenuStrip = _ContextMenuStrip1;
				if (contextMenuStrip != null)
				{
					contextMenuStrip.Opening -= value2;
				}
				_ContextMenuStrip1 = value;
				contextMenuStrip = _ContextMenuStrip1;
				if (contextMenuStrip != null)
				{
					contextMenuStrip.Opening += value2;
				}
			}
		}

		internal virtual ToolStripMenuItem SortToolStripMenuItem
		{
			[CompilerGenerated]
			get
			{
				return _SortToolStripMenuItem;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = SortToolStripMenuItem_Click;
				ToolStripMenuItem sortToolStripMenuItem = _SortToolStripMenuItem;
				if (sortToolStripMenuItem != null)
				{
					sortToolStripMenuItem.Click -= value2;
				}
				_SortToolStripMenuItem = value;
				sortToolStripMenuItem = _SortToolStripMenuItem;
				if (sortToolStripMenuItem != null)
				{
					sortToolStripMenuItem.Click += value2;
				}
			}
		}

		[field: AccessedThroughProperty("tsmTB")]
		internal virtual ToolStripTextBox tsmTB
		{
			get;
			[MethodImpl(MethodImplOptions.Synchronized)]
			set;
		}

		internal virtual ToolStripButton tsbFind
		{
			[CompilerGenerated]
			get
			{
				return _tsbFind;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = tsbFind_Click;
				ToolStripButton tsbFind = _tsbFind;
				if (tsbFind != null)
				{
					tsbFind.Click -= value2;
				}
				_tsbFind = value;
				tsbFind = _tsbFind;
				if (tsbFind != null)
				{
					tsbFind.Click += value2;
				}
			}
		}

		internal virtual ToolStripButton tsbClear
		{
			[CompilerGenerated]
			get
			{
				return _tsbClear;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				EventHandler value2 = tsbClear_Click;
				ToolStripButton tsbClear = _tsbClear;
				if (tsbClear != null)
				{
					tsbClear.Click -= value2;
				}
				_tsbClear = value;
				tsbClear = _tsbClear;
				if (tsbClear != null)
				{
					tsbClear.Click += value2;
				}
			}
		}

		protected virtual clsPrintLocationList cPrLoc
		{
			[CompilerGenerated]
			get
			{
				return _cPrLoc;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				clsPrintLocationList.PrintProgressEventHandler obj = cPrChar_PrintProgress;
				clsPrintLocationList cPrLoc = _cPrLoc;
				if (cPrLoc != null)
				{
					cPrLoc.PrintProgress -= obj;
				}
				_cPrLoc = value;
				cPrLoc = _cPrLoc;
				if (cPrLoc != null)
				{
					cPrLoc.PrintProgress += obj;
				}
			}
		}

		protected virtual clsPrintItemList cPrItem
		{
			[CompilerGenerated]
			get
			{
				return _cPrItem;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				clsPrintItemList.PrintProgressEventHandler obj = cPrChar_PrintProgress;
				clsPrintItemList cPrItem = _cPrItem;
				if (cPrItem != null)
				{
					cPrItem.PrintProgress -= obj;
				}
				_cPrItem = value;
				cPrItem = _cPrItem;
				if (cPrItem != null)
				{
					cPrItem.PrintProgress += obj;
				}
			}
		}

		protected virtual clsPrintCharList cPrChar
		{
			[CompilerGenerated]
			get
			{
				return _cPrChar;
			}
			[MethodImpl(MethodImplOptions.Synchronized)]
			[CompilerGenerated]
			set
			{
				clsPrintCharList.PrintProgressEventHandler obj = cPrChar_PrintProgress;
				clsPrintCharList cPrChar = _cPrChar;
				if (cPrChar != null)
				{
					cPrChar.PrintProgress -= obj;
				}
				_cPrChar = value;
				cPrChar = _cPrChar;
				if (cPrChar != null)
				{
					cPrChar.PrintProgress += obj;
				}
			}
		}

		[DebuggerNonUserCode]
		protected override void Dispose(bool Disposing)
		{
			if (Disposing && components != null)
			{
				components.Dispose();
			}
			base.Dispose(Disposing);
		}

		[System.Diagnostics.DebuggerStepThrough]
		private void InitializeComponent()
		{
			components = new System.ComponentModel.Container();
			System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(yWriter6.frmList));
			ToolTip1 = new System.Windows.Forms.ToolTip(components);
			BottomToolStripPanel = new System.Windows.Forms.ToolStripPanel();
			TopToolStripPanel = new System.Windows.Forms.ToolStripPanel();
			RightToolStripPanel = new System.Windows.Forms.ToolStripPanel();
			LeftToolStripPanel = new System.Windows.Forms.ToolStripPanel();
			ContentPanel = new System.Windows.Forms.ToolStripContentPanel();
			ListItems = new System.Windows.Forms.ListView();
			ColShortName = new System.Windows.Forms.ColumnHeader();
			colFullName = new System.Windows.Forms.ColumnHeader();
			colExtra = new System.Windows.Forms.ColumnHeader();
			ContextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(components);
			SortToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
			cmdOK = new System.Windows.Forms.Button();
			chkOnlyMajor = new System.Windows.Forms.CheckBox();
			cmdCancel = new System.Windows.Forms.Button();
			ToolStrip2 = new System.Windows.Forms.ToolStrip();
			tsbChar = new System.Windows.Forms.ToolStripButton();
			tsbItems = new System.Windows.Forms.ToolStripButton();
			tsbLocations = new System.Windows.Forms.ToolStripButton();
			tsbSep = new System.Windows.Forms.ToolStripSeparator();
			tsbAdd = new System.Windows.Forms.ToolStripButton();
			tsbEdit = new System.Windows.Forms.ToolStripButton();
			tsbDel = new System.Windows.Forms.ToolStripButton();
			ToolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
			tsbPrintList = new System.Windows.Forms.ToolStripButton();
			ToolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
			tsbHelp = new System.Windows.Forms.ToolStripButton();
			tsmTB = new System.Windows.Forms.ToolStripTextBox();
			tsbFind = new System.Windows.Forms.ToolStripButton();
			tsbClear = new System.Windows.Forms.ToolStripButton();
			Panel2 = new System.Windows.Forms.Panel();
			Panel3 = new System.Windows.Forms.Panel();
			StatusStrip1 = new System.Windows.Forms.StatusStrip();
			tssStatus = new System.Windows.Forms.ToolStripStatusLabel();
			ContextMenuStrip1.SuspendLayout();
			ToolStrip2.SuspendLayout();
			Panel2.SuspendLayout();
			Panel3.SuspendLayout();
			StatusStrip1.SuspendLayout();
			SuspendLayout();
			BottomToolStripPanel.Location = new System.Drawing.Point(0, 0);
			BottomToolStripPanel.Name = "BottomToolStripPanel";
			BottomToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
			BottomToolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
			BottomToolStripPanel.Size = new System.Drawing.Size(0, 0);
			TopToolStripPanel.Location = new System.Drawing.Point(0, 0);
			TopToolStripPanel.Name = "TopToolStripPanel";
			TopToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
			TopToolStripPanel.Padding = new System.Windows.Forms.Padding(3);
			TopToolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
			TopToolStripPanel.Size = new System.Drawing.Size(0, 0);
			RightToolStripPanel.Location = new System.Drawing.Point(0, 0);
			RightToolStripPanel.Name = "RightToolStripPanel";
			RightToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
			RightToolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
			RightToolStripPanel.Size = new System.Drawing.Size(0, 0);
			LeftToolStripPanel.Location = new System.Drawing.Point(0, 0);
			LeftToolStripPanel.Name = "LeftToolStripPanel";
			LeftToolStripPanel.Orientation = System.Windows.Forms.Orientation.Horizontal;
			LeftToolStripPanel.RowMargin = new System.Windows.Forms.Padding(3, 0, 0, 0);
			LeftToolStripPanel.Size = new System.Drawing.Size(0, 0);
			ContentPanel.Size = new System.Drawing.Size(628, 440);
			ListItems.AllowDrop = true;
			ListItems.BackColor = System.Drawing.SystemColors.Window;
			ListItems.Columns.AddRange(new System.Windows.Forms.ColumnHeader[3]
			{
				ColShortName,
				colFullName,
				colExtra
			});
			ListItems.ContextMenuStrip = ContextMenuStrip1;
			ListItems.Dock = System.Windows.Forms.DockStyle.Fill;
			ListItems.Font = new System.Drawing.Font("Segoe UI", 9f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
			ListItems.ForeColor = System.Drawing.SystemColors.WindowText;
			ListItems.FullRowSelect = true;
			ListItems.HideSelection = false;
			ListItems.Location = new System.Drawing.Point(7, 7);
			ListItems.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			ListItems.Name = "ListItems";
			ListItems.Size = new System.Drawing.Size(663, 406);
			ListItems.TabIndex = 12;
			ListItems.UseCompatibleStateImageBehavior = false;
			ListItems.View = System.Windows.Forms.View.Details;
			ColShortName.Text = "Short Name";
			ColShortName.Width = 132;
			colFullName.Text = "Full Name";
			colFullName.Width = 247;
			colExtra.Text = "Aka";
			colExtra.Width = 129;
			ContextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[1]
			{
				SortToolStripMenuItem
			});
			ContextMenuStrip1.Name = "ContextMenuStrip1";
			ContextMenuStrip1.Size = new System.Drawing.Size(221, 32);
			SortToolStripMenuItem.Name = "SortToolStripMenuItem";
			SortToolStripMenuItem.Size = new System.Drawing.Size(220, 28);
			SortToolStripMenuItem.Text = "Sort alphabetically";
			cmdOK.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
			cmdOK.BackColor = System.Drawing.SystemColors.Control;
			cmdOK.Cursor = System.Windows.Forms.Cursors.Default;
			cmdOK.Font = new System.Drawing.Font("Arial", 8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
			cmdOK.ForeColor = System.Drawing.SystemColors.ControlText;
			cmdOK.Location = new System.Drawing.Point(573, 16);
			cmdOK.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			cmdOK.Name = "cmdOK";
			cmdOK.RightToLeft = System.Windows.Forms.RightToLeft.No;
			cmdOK.Size = new System.Drawing.Size(90, 49);
			cmdOK.TabIndex = 4;
			cmdOK.Text = "OK";
			cmdOK.UseVisualStyleBackColor = true;
			chkOnlyMajor.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
			chkOnlyMajor.BackColor = System.Drawing.SystemColors.Control;
			chkOnlyMajor.Cursor = System.Windows.Forms.Cursors.Default;
			chkOnlyMajor.Font = new System.Drawing.Font("Arial", 8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
			chkOnlyMajor.ForeColor = System.Drawing.SystemColors.ControlText;
			chkOnlyMajor.Location = new System.Drawing.Point(226, 28);
			chkOnlyMajor.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			chkOnlyMajor.Name = "chkOnlyMajor";
			chkOnlyMajor.RightToLeft = System.Windows.Forms.RightToLeft.No;
			chkOnlyMajor.Size = new System.Drawing.Size(251, 28);
			chkOnlyMajor.TabIndex = 11;
			chkOnlyMajor.Text = "Only show major characters";
			chkOnlyMajor.UseVisualStyleBackColor = false;
			cmdCancel.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
			cmdCancel.BackColor = System.Drawing.SystemColors.Control;
			cmdCancel.Cursor = System.Windows.Forms.Cursors.Default;
			cmdCancel.Font = new System.Drawing.Font("Arial", 8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
			cmdCancel.ForeColor = System.Drawing.SystemColors.ControlText;
			cmdCancel.Location = new System.Drawing.Point(14, 17);
			cmdCancel.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			cmdCancel.Name = "cmdCancel";
			cmdCancel.RightToLeft = System.Windows.Forms.RightToLeft.No;
			cmdCancel.Size = new System.Drawing.Size(110, 49);
			cmdCancel.TabIndex = 6;
			cmdCancel.Text = "Cancel";
			cmdCancel.UseVisualStyleBackColor = true;
			ToolStrip2.ImageScalingSize = new System.Drawing.Size(32, 32);
			ToolStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[14]
			{
				tsbChar,
				tsbItems,
				tsbLocations,
				tsbSep,
				tsbAdd,
				tsbEdit,
				tsbDel,
				ToolStripSeparator4,
				tsbPrintList,
				ToolStripSeparator1,
				tsbHelp,
				tsmTB,
				tsbFind,
				tsbClear
			});
			ToolStrip2.Location = new System.Drawing.Point(0, 0);
			ToolStrip2.Name = "ToolStrip2";
			ToolStrip2.Size = new System.Drawing.Size(677, 39);
			ToolStrip2.TabIndex = 14;
			ToolStrip2.Text = "ToolStrip2";
			tsbChar.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
			tsbChar.Image = yWriter6.My.Resources.Resources.yw_Char;
			tsbChar.ImageTransparentColor = System.Drawing.Color.Magenta;
			tsbChar.Name = "tsbChar";
			tsbChar.Size = new System.Drawing.Size(36, 36);
			tsbChar.Text = "ToolStripButton1";
			tsbChar.ToolTipText = "Characters";
			tsbItems.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
			tsbItems.Image = yWriter6.My.Resources.Resources.yw_Item;
			tsbItems.ImageTransparentColor = System.Drawing.Color.Magenta;
			tsbItems.Name = "tsbItems";
			tsbItems.Size = new System.Drawing.Size(36, 36);
			tsbItems.Text = "ToolStripButton2";
			tsbItems.ToolTipText = "Items";
			tsbLocations.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
			tsbLocations.Image = yWriter6.My.Resources.Resources.yw_Location;
			tsbLocations.ImageTransparentColor = System.Drawing.Color.Magenta;
			tsbLocations.Name = "tsbLocations";
			tsbLocations.Size = new System.Drawing.Size(36, 36);
			tsbLocations.ToolTipText = "Locations";
			tsbSep.AutoSize = false;
			tsbSep.Name = "tsbSep";
			tsbSep.Size = new System.Drawing.Size(16, 39);
			tsbAdd.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
			tsbAdd.Image = yWriter6.My.Resources.Resources.RMP_Add;
			tsbAdd.ImageTransparentColor = System.Drawing.Color.Magenta;
			tsbAdd.Name = "tsbAdd";
			tsbAdd.Size = new System.Drawing.Size(36, 36);
			tsbAdd.Text = "ToolStripButton1";
			tsbAdd.ToolTipText = "Add new";
			tsbEdit.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
			tsbEdit.Image = yWriter6.My.Resources.Resources.RMP_Edit;
			tsbEdit.ImageTransparentColor = System.Drawing.Color.Magenta;
			tsbEdit.Name = "tsbEdit";
			tsbEdit.Size = new System.Drawing.Size(36, 36);
			tsbEdit.Text = "ToolStripButton2";
			tsbEdit.ToolTipText = "Edit selected";
			tsbDel.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
			tsbDel.Image = yWriter6.My.Resources.Resources.RMP_Del;
			tsbDel.ImageTransparentColor = System.Drawing.Color.Magenta;
			tsbDel.Name = "tsbDel";
			tsbDel.Size = new System.Drawing.Size(36, 36);
			tsbDel.Text = "ToolStripButton3";
			tsbDel.ToolTipText = "Delete selected";
			ToolStripSeparator4.AutoSize = false;
			ToolStripSeparator4.Name = "ToolStripSeparator4";
			ToolStripSeparator4.Size = new System.Drawing.Size(16, 39);
			tsbPrintList.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
			tsbPrintList.Image = yWriter6.My.Resources.Resources.yw_Print;
			tsbPrintList.ImageTransparentColor = System.Drawing.Color.Magenta;
			tsbPrintList.Name = "tsbPrintList";
			tsbPrintList.Size = new System.Drawing.Size(36, 36);
			tsbPrintList.Text = "ToolStripButton6";
			tsbPrintList.ToolTipText = "Print list";
			ToolStripSeparator1.AutoSize = false;
			ToolStripSeparator1.Name = "ToolStripSeparator1";
			ToolStripSeparator1.Size = new System.Drawing.Size(10, 39);
			tsbHelp.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
			tsbHelp.Image = yWriter6.My.Resources.Resources.RMP_Help;
			tsbHelp.ImageTransparentColor = System.Drawing.Color.Magenta;
			tsbHelp.Name = "tsbHelp";
			tsbHelp.Size = new System.Drawing.Size(36, 36);
			tsbHelp.Text = "Help";
			tsmTB.Name = "tsmTB";
			tsmTB.Size = new System.Drawing.Size(116, 39);
			tsbFind.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
			tsbFind.Image = (System.Drawing.Image)resources.GetObject("tsbFind.Image");
			tsbFind.ImageTransparentColor = System.Drawing.Color.Magenta;
			tsbFind.Name = "tsbFind";
			tsbFind.Size = new System.Drawing.Size(46, 36);
			tsbFind.Text = "Find";
			tsbClear.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
			tsbClear.ImageTransparentColor = System.Drawing.Color.Magenta;
			tsbClear.Name = "tsbClear";
			tsbClear.Size = new System.Drawing.Size(24, 36);
			tsbClear.Text = "X";
			tsbClear.TextImageRelation = System.Windows.Forms.TextImageRelation.TextAboveImage;
			Panel2.Controls.Add(cmdCancel);
			Panel2.Controls.Add(cmdOK);
			Panel2.Controls.Add(chkOnlyMajor);
			Panel2.Dock = System.Windows.Forms.DockStyle.Bottom;
			Panel2.Location = new System.Drawing.Point(0, 459);
			Panel2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			Panel2.Name = "Panel2";
			Panel2.Size = new System.Drawing.Size(677, 79);
			Panel2.TabIndex = 15;
			Panel3.Controls.Add(ListItems);
			Panel3.Dock = System.Windows.Forms.DockStyle.Fill;
			Panel3.Location = new System.Drawing.Point(0, 39);
			Panel3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			Panel3.Name = "Panel3";
			Panel3.Padding = new System.Windows.Forms.Padding(7, 7, 7, 7);
			Panel3.Size = new System.Drawing.Size(677, 420);
			Panel3.TabIndex = 16;
			StatusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[1]
			{
				tssStatus
			});
			StatusStrip1.Location = new System.Drawing.Point(0, 538);
			StatusStrip1.Name = "StatusStrip1";
			StatusStrip1.Padding = new System.Windows.Forms.Padding(1, 0, 16, 0);
			StatusStrip1.Size = new System.Drawing.Size(677, 28);
			StatusStrip1.TabIndex = 17;
			StatusStrip1.Text = "StatusStrip1";
			tssStatus.Name = "tssStatus";
			tssStatus.Size = new System.Drawing.Size(25, 23);
			tssStatus.Text = "   ";
			base.AutoScaleDimensions = new System.Drawing.SizeF(7f, 17f);
			base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			BackColor = System.Drawing.SystemColors.Control;
			base.ClientSize = new System.Drawing.Size(677, 566);
			base.Controls.Add(Panel3);
			base.Controls.Add(ToolStrip2);
			base.Controls.Add(Panel2);
			base.Controls.Add(StatusStrip1);
			Cursor = System.Windows.Forms.Cursors.Default;
			DoubleBuffered = true;
			Font = new System.Drawing.Font("Segoe UI", 10f);
			base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
			base.Location = new System.Drawing.Point(2, 21);
			base.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
			MinimumSize = new System.Drawing.Size(527, 510);
			base.Name = "frmList";
			RightToLeft = System.Windows.Forms.RightToLeft.No;
			base.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
			Text = "Items";
			ContextMenuStrip1.ResumeLayout(false);
			ToolStrip2.ResumeLayout(false);
			ToolStrip2.PerformLayout();
			Panel2.ResumeLayout(false);
			Panel3.ResumeLayout(false);
			StatusStrip1.ResumeLayout(false);
			StatusStrip1.PerformLayout();
			ResumeLayout(false);
			PerformLayout();
		}

		public frmList(ref clsProject ProjectClass, eRecord RecType)
		{
			base.Load += frmList_Load;
			base.FormClosing += frmList_FormClosing;
			cFill = new clsFillList();
			HighlightedItem = new Rectangle(0, 0, 0, 0);
			cPrLoc = new clsPrintLocationList();
			cPrItem = new clsPrintItemList();
			cPrChar = new clsPrintCharList();
			SuppressChange = true;
			InitializeComponent();
			SuppressChange = false;
			cProject = ProjectClass;
			AddProjectHandlers();
			eType = RecType;
		}

		public DialogResult ShowDialog(bool AllowSwitching)
		{
			if (AllowSwitching)
			{
				tsbItems.Visible = true;
				tsbLocations.Visible = true;
				tsbChar.Visible = true;
				tsbSep.Visible = true;
			}
			else
			{
				tsbItems.Visible = false;
				tsbLocations.Visible = false;
				tsbChar.Visible = false;
				tsbSep.Visible = false;
			}
			ListItems.FocusedItem = null;
			Setup();
			FillList();
			return ShowDialog();
		}

		private void chkOnlyMajor_CheckStateChanged(object eventSender, EventArgs eventArgs)
		{
			if (!SuppressChange)
			{
				if (chkOnlyMajor.CheckState == CheckState.Checked)
				{
					OnlyMajor = true;
				}
				else
				{
					OnlyMajor = false;
				}
				FillList();
			}
		}

		private void tsbAdd_Click(object eventSender, EventArgs eventArgs)
		{
			bool flag;
			do
			{
				flag = false;
				switch (eType)
				{
				default:
					return;
				case eRecord.eCharacter:
					try
					{
						int num = cProject.AddNewChar();
						if (modEditChar.EditChar(ref cProject, num))
						{
							flag = true;
						}
						else
						{
							cProject.RemoveCharByID(num);
						}
					}
					catch (Exception ex5)
					{
						ProjectData.SetProjectError(ex5);
						Exception ex6 = ex5;
						clsShared.cLog.AddAction(ex6, MethodBase.GetCurrentMethod());
						ProjectData.ClearProjectError();
					}
					break;
				case eRecord.eItem:
					try
					{
						int num = cProject.AddNewItem();
						if (modEditItem.EditItem(ref cProject, num))
						{
							flag = true;
						}
						else
						{
							cProject.RemoveItemByID(num);
						}
					}
					catch (Exception ex3)
					{
						ProjectData.SetProjectError(ex3);
						Exception ex4 = ex3;
						clsShared.cLog.AddAction(ex4, MethodBase.GetCurrentMethod());
						ProjectData.ClearProjectError();
					}
					break;
				case eRecord.eLocation:
					try
					{
						int num = cProject.AddNewLocation();
						if (modEditLocation.EditLocation(ref cProject, num))
						{
							flag = true;
						}
						else
						{
							cProject.RemoveLocationByID(num);
						}
					}
					catch (Exception ex)
					{
						ProjectData.SetProjectError(ex);
						Exception ex2 = ex;
						clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
						ProjectData.ClearProjectError();
					}
					break;
				}
				if (flag)
				{
					FillList();
				}
			}
			while (flag);
		}

		private void cmdCancel_Click(object eventSender, EventArgs eventArgs)
		{
			Cancelled = true;
			Hide();
		}

		private void tsbChar_Click(object eventSender, EventArgs eventArgs)
		{
			if (!SuppressChange)
			{
				SaveSortOrder();
				if (eType != eRecord.eCharacter)
				{
					clsSettings cSettings = clsShared.cSettings;
					string prefix = "ShowList" + Conversions.ToString((int)eType);
					ListView List = ListItems;
					cSettings.StoreColumnSettings(prefix, ref List);
					ListItems = List;
				}
				eType = eRecord.eCharacter;
				ListItems.FocusedItem = null;
				Setup();
				FillList();
			}
		}

		private void tsbDel_Click(object eventSender, EventArgs eventArgs)
		{
			//Discarded unreachable code: IL_01e0, IL_01f7, IL_0202, IL_0212, IL_02b0, IL_02b2, IL_02c6, IL_02e8
			int num = default(int);
			int num3 = default(int);
			try
			{
				ProjectData.ClearProjectError();
				num = 2;
				int num2 = 2;
				if (ListItems.SelectedItems.Count != 0)
				{
					num2 = 4;
					if (eType == eRecord.eCharacter)
					{
						num2 = 5;
						IEnumerator enumerator = ListItems.SelectedItems.GetEnumerator();
						while (true)
						{
							if (!enumerator.MoveNext())
							{
								num2 = 11;
								if (enumerator is IDisposable)
								{
									(enumerator as IDisposable).Dispose();
								}
								break;
							}
							ListViewItem listViewItem = (ListViewItem)enumerator.Current;
							num2 = 6;
							int charID = Conversions.ToInteger(listViewItem.Tag);
							num2 = 7;
							if (!cProject.IsViewpointSomewhere(charID))
							{
								num2 = 10;
								continue;
							}
							num2 = 8;
							clsShared.cLang.TransMsgBox("You can't delete viewpoint characters. First change the viewpoint character for the scenes in question, then delete the character.");
							goto end_IL_0000;
						}
					}
					num2 = 12;
					if (clsShared.cLang.TransMsgBox("Are you sure you want to delete all selected " + eTypeString(eType) + "s?", MsgBoxStyle.YesNo) != MsgBoxResult.No)
					{
						num2 = 14;
						SuspendRedraw = true;
						num2 = 15;
						IEnumerator enumerator2 = ListItems.SelectedItems.GetEnumerator();
						while (enumerator2.MoveNext())
						{
							ListViewItem listViewItem = (ListViewItem)enumerator2.Current;
							num2 = 16;
							int charID = Conversions.ToInteger(listViewItem.Tag);
							num2 = 17;
							switch (eType)
							{
							case eRecord.eCharacter:
								num2 = 19;
								_ = cProject.get_CharByID(charID).Title;
								num2 = 20;
								cProject.RemoveCharByID(charID);
								break;
							case eRecord.eItem:
								num2 = 22;
								_ = cProject.get_ItemByID(charID).Title;
								num2 = 23;
								cProject.RemoveItemByID(charID);
								break;
							case eRecord.eLocation:
								num2 = 25;
								_ = cProject.get_LocationByID(charID).Title;
								num2 = 26;
								cProject.RemoveLocationByID(charID);
								break;
							}
							num2 = 29;
						}
						num2 = 30;
						if (enumerator2 is IDisposable)
						{
							(enumerator2 as IDisposable).Dispose();
						}
						num2 = 31;
						SuspendRedraw = false;
						num2 = 32;
						FillList();
					}
				}
				end_IL_0000:;
			}
			catch (Exception obj) when ((obj is Exception && num != 0) & (num3 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_02e6: Could not find block for branch target IL_02b2*/;
			}
			if (num3 != 0)
			{
				ProjectData.ClearProjectError();
			}
		}

		private void tsbEdit_Click(object eventSender, EventArgs eventArgs)
		{
			//Discarded unreachable code: IL_00a1, IL_00b8, IL_00c3, IL_00d3, IL_012d, IL_012f, IL_0143, IL_0165
			int num = default(int);
			int num4 = default(int);
			try
			{
				ProjectData.ClearProjectError();
				num = 2;
				int num2 = 2;
				if (ListItems.FocusedItem != null)
				{
					num2 = 4;
					int num3 = Conversions.ToInteger(ListItems.FocusedItem.Tag);
					num2 = 5;
					bool flag = default(bool);
					switch (eType)
					{
					case eRecord.eItem:
						num2 = 7;
						flag = modEditItem.EditItem(ref cProject, num3);
						break;
					case eRecord.eCharacter:
						num2 = 9;
						flag = modEditChar.EditChar(ref cProject, num3);
						break;
					case eRecord.eLocation:
						num2 = 11;
						flag = modEditLocation.EditLocation(ref cProject, num3);
						break;
					default:
						num2 = 13;
						clsShared.cLang.TransMsgBox("Fatal Error: No type specified");
						break;
					}
					num2 = 15;
					if (!flag)
					{
					}
				}
			}
			catch (Exception obj) when ((obj is Exception && num != 0) & (num4 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_0163: Could not find block for branch target IL_012f*/;
			}
			if (num4 != 0)
			{
				ProjectData.ClearProjectError();
			}
		}

		private void tsbItems_Click(object eventSender, EventArgs eventArgs)
		{
			if (!SuppressChange)
			{
				if (eType != eRecord.eItem)
				{
					clsSettings cSettings = clsShared.cSettings;
					string prefix = "ShowList" + Conversions.ToString((int)eType);
					ListView List = ListItems;
					cSettings.StoreColumnSettings(prefix, ref List);
					ListItems = List;
				}
				SaveSortOrder();
				eType = eRecord.eItem;
				ListItems.FocusedItem = null;
				Setup();
				FillList();
			}
		}

		private void tsbLoc_Click(object eventSender, EventArgs eventArgs)
		{
			if (!SuppressChange)
			{
				if (eType != eRecord.eLocation)
				{
					clsSettings cSettings = clsShared.cSettings;
					string prefix = "ShowList" + Conversions.ToString((int)eType);
					ListView List = ListItems;
					cSettings.StoreColumnSettings(prefix, ref List);
					ListItems = List;
				}
				SaveSortOrder();
				eType = eRecord.eLocation;
				ListItems.FocusedItem = null;
				Setup();
				FillList();
			}
		}

		private void cmdOK_Click(object eventSender, EventArgs eventArgs)
		{
			Cancelled = false;
			Hide();
		}

		private void frmList_Load(object eventSender, EventArgs eventArgs)
		{
			try
			{
				clsSettings cSettings = clsShared.cSettings;
				Form Form = this;
				cSettings.ReadWindowSettings("ItemList", ref Form);
				clsShared.cFormFont.SetFormFont(this, clsShared.cSettings.sGet("FormFont", modVariables.DefaultUIFont.Name), clsShared.cSettings.sGet("UIFontSize", modVariables.DefaultUIFont.Size));
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}

		private void FillList()
		{
			//Discarded unreachable code: IL_02b6, IL_02cd, IL_02d8, IL_02e8, IL_03a6, IL_03a8, IL_03bc, IL_03de
			int num = default(int);
			int num3 = default(int);
			try
			{
				ProjectData.ClearProjectError();
				num = 2;
				int num2 = 2;
				if (!SuspendRedraw)
				{
					num2 = 4;
					string text = "";
					num2 = 5;
					if (ListItems.FocusedItem != null)
					{
						num2 = 6;
						text = ListItems.FocusedItem.Name;
					}
					num2 = 7;
					ListItems.Items.Clear();
					num2 = 8;
					clsSettings cSettings = clsShared.cSettings;
					string prefix = "ShowList" + Conversions.ToString((int)eType);
					ListView List = ListItems;
					cSettings.ReadColumnSettings(prefix, ref List);
					ListItems = List;
					num2 = 9;
					switch (eType)
					{
					case eRecord.eCharacter:
					{
						num2 = 11;
						chkOnlyMajor.Visible = true;
						num2 = 12;
						clsFillList clsFillList3 = cFill;
						clsProject clsProject3 = cProject;
						List = ListItems;
						clsFillList3.FillAllCharList(clsProject3, ref List, chkOnlyMajor.Checked);
						break;
					}
					case eRecord.eItem:
					{
						num2 = 14;
						chkOnlyMajor.Visible = false;
						num2 = 15;
						clsFillList clsFillList2 = cFill;
						clsProject clsProject2 = cProject;
						List = ListItems;
						clsFillList2.FillAllItems(clsProject2, ref List);
						ListItems = List;
						break;
					}
					case eRecord.eLocation:
					{
						num2 = 17;
						chkOnlyMajor.Visible = false;
						num2 = 18;
						clsFillList clsFillList = cFill;
						clsProject clsProject = cProject;
						List = ListItems;
						clsFillList.FillAllLocations(clsProject, ref List);
						ListItems = List;
						break;
					}
					default:
						num2 = 20;
						clsShared.cLang.TransMsgBox("Fatal error: You can't display the fill/pick list without calling showform first.");
						goto end_IL_0000;
					}
					num2 = 23;
					if (ListItems.Items.Count > 0)
					{
						num2 = 24;
						if (Operators.CompareString(text, "", TextCompare: false) != 0)
						{
							num2 = 25;
							if (ListItems.FocusedItem != null)
							{
								num2 = 26;
								ListItems.Items[ListItems.FocusedItem.Index].Selected = false;
							}
							num2 = 27;
							if (!ListItems.Items.ContainsKey(text))
							{
								num2 = 28;
								text = ListItems.Items[0].Name;
							}
							num2 = 29;
							ListItems.Items[text].Selected = true;
							num2 = 30;
							ListItems.FocusedItem = ListItems.Items[text];
							num2 = 31;
							ListItems.FocusedItem.EnsureVisible();
						}
						num2 = 32;
						tsbDel.Enabled = true;
						num2 = 33;
						tsbEdit.Enabled = true;
						num2 = 34;
						ListItems.Enabled = true;
					}
					else
					{
						num2 = 36;
						tsbDel.Enabled = false;
						num2 = 37;
						tsbEdit.Enabled = false;
						num2 = 38;
						ListItems.Enabled = false;
					}
					num2 = 39;
					SaveSortOrder();
					num2 = 40;
					cDelay.DoEvents();
				}
				end_IL_0000:;
			}
			catch (Exception obj) when ((obj is Exception && num != 0) & (num3 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_03dc: Could not find block for branch target IL_03a8*/;
			}
			if (num3 != 0)
			{
				ProjectData.ClearProjectError();
			}
		}

		private void frmList_FormClosing(object eventSender, FormClosingEventArgs eventArgs)
		{
			if (eventArgs.CloseReason == CloseReason.UserClosing)
			{
				SaveSortOrder();
				SaveFormSettings();
			}
			RemoveProjectHandlers();
		}

		private void Setup()
		{
			try
			{
				Text = "All " + eTypeString(eType) + "s";
				Text += " (Drag/drop to rearrange the order)";
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				clsShared.cLog.AddAction(ex2, MethodBase.GetCurrentMethod());
				ProjectData.ClearProjectError();
			}
		}

		private string eTypeString(eRecord eType)
		{
			switch (eType)
			{
			case eRecord.eCharacter:
				return "character";
			case eRecord.eItem:
				return "item";
			case eRecord.eLocation:
				return "location";
			default:
				return "";
			}
		}

		private void ListItems_DoubleClick(object eventSender, EventArgs eventArgs)
		{
			//Discarded unreachable code: IL_0090, IL_00a7, IL_00b2, IL_00c2, IL_0114, IL_0116, IL_012a, IL_014c
			int num2 = default(int);
			int num4 = default(int);
			try
			{
				int num = 1;
				if (ListItems.FocusedItem != null)
				{
					ProjectData.ClearProjectError();
					num2 = 2;
					num = 4;
					int num3 = Conversions.ToInteger(ListItems.FocusedItem.Tag);
					num = 5;
					if (num3 > 0)
					{
						num = 6;
						switch (eType)
						{
						case eRecord.eCharacter:
							num = 8;
							if (!modEditChar.EditChar(ref cProject, num3))
							{
							}
							break;
						case eRecord.eItem:
							num = 10;
							if (!modEditItem.EditItem(ref cProject, num3))
							{
							}
							break;
						case eRecord.eLocation:
							num = 12;
							if (!modEditLocation.EditLocation(ref cProject, num3))
							{
							}
							break;
						}
					}
				}
			}
			catch (Exception obj) when ((obj is Exception && num2 != 0) & (num4 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_014a: Could not find block for branch target IL_0116*/;
			}
			if (num4 != 0)
			{
				ProjectData.ClearProjectError();
			}
		}

		private void SaveSortOrder()
		{
			//Discarded unreachable code: IL_00c0, IL_00d7, IL_00e2, IL_00f2, IL_0140, IL_0142, IL_0156, IL_0178
			int num = default(int);
			int num4 = default(int);
			try
			{
				ProjectData.ClearProjectError();
				num = 2;
				int num2 = 2;
				int num3 = ListItems.Items.Count - 1;
				for (int i = 0; i <= num3; i++)
				{
					num2 = 3;
					int iD = Conversions.ToInteger(ListItems.Items[i].Tag);
					num2 = 4;
					if (eType == eRecord.eCharacter)
					{
						num2 = 5;
						cProject.get_CharByID(iD).SortOrder = i + 1;
					}
					else
					{
						num2 = 7;
						if (eType == eRecord.eLocation)
						{
							num2 = 8;
							cProject.get_LocationByID(iD).SortOrder = i + 1;
						}
						else
						{
							num2 = 10;
							if (eType == eRecord.eItem)
							{
								num2 = 11;
								cProject.get_ItemByID(iD).SortOrder = i + 1;
							}
						}
					}
					num2 = 12;
				}
			}
			catch (Exception obj) when ((obj is Exception && num != 0) & (num4 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_0176: Could not find block for branch target IL_0142*/;
			}
			if (num4 != 0)
			{
				ProjectData.ClearProjectError();
			}
		}

		private void ListItems_DragDrop(object sender, DragEventArgs e)
		{
			if (HighlightedItem != Rectangle.Empty)
			{
				ListItems.Invalidate(HighlightedItem);
			}
			if (e.Effect != DragDropEffects.Move)
			{
				return;
			}
			string[] array = (string[])e.Data.GetData(DataFormats.StringFormat);
			if (array.Length == 0)
			{
				return;
			}
			Point point = ListItems.PointToClient(new Point(e.X, e.Y));
			ListViewItem itemAt = ListItems.GetItemAt(point.X, point.Y);
			if (itemAt == null)
			{
				e.Effect = DragDropEffects.None;
				return;
			}
			ListItems.FocusedItem = itemAt;
			int destID = Conversions.ToInteger(itemAt.Tag);
			int num = array.Length - 1;
			for (int i = 0; i <= num; i++)
			{
				int sourceID = Conversions.ToInteger(array[i]);
				if (eType == eRecord.eCharacter)
				{
					cProject.ChangeCharSortOrder(sourceID, destID);
				}
				else if (eType == eRecord.eLocation)
				{
					cProject.ChangeLocationSortOrder(sourceID, destID);
				}
				else if (eType == eRecord.eItem)
				{
					cProject.ChangeItemSortOrder(sourceID, destID);
				}
			}
			if (eType == eRecord.eCharacter)
			{
				cProject.ResortCharacters();
			}
			else if (eType == eRecord.eLocation)
			{
				cProject.ResortLocations();
			}
			else if (eType == eRecord.eItem)
			{
				cProject.ResortItems();
			}
			FillList();
		}

		private void ListItems_DragLeave(object sender, EventArgs e)
		{
			if (HighlightedItem != Rectangle.Empty)
			{
				ListItems.Invalidate(HighlightedItem);
			}
		}

		private void ListItems_DragOver(object sender, DragEventArgs e)
		{
			if (e.Data.GetDataPresent(DataFormats.StringFormat, autoConvert: false))
			{
				e.Effect = DragDropEffects.Move;
				clsListItemHighlight clsListItemHighlight = new clsListItemHighlight();
				ListView TargetList = ListItems;
				clsListItemHighlight.HighlightTarget(e, ref TargetList, ref HighlightedItem);
				ListItems = TargetList;
			}
		}

		private void ListItems_ItemDrag(object sender, ItemDragEventArgs e)
		{
			if (e.Button == MouseButtons.Left)
			{
				string[] array = new string[ListItems.SelectedItems.Count - 1 + 1];
				int num = 0;
				IEnumerator enumerator = default(IEnumerator);
				try
				{
					enumerator = ListItems.SelectedItems.GetEnumerator();
					while (enumerator.MoveNext())
					{
						ListViewItem listViewItem = (ListViewItem)enumerator.Current;
						array[num] = Conversions.ToString(listViewItem.Tag);
						num++;
					}
				}
				finally
				{
					if (enumerator is IDisposable)
					{
						(enumerator as IDisposable).Dispose();
					}
				}
				DoDragDrop(new DataObject(DataFormats.StringFormat, array), DragDropEffects.Move);
			}
		}

		private void ListItems_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (!SuppressChange && ListItems.FocusedItem != null)
			{
				_ = ListItems.FocusedItem.Index;
			}
		}

		private void SaveFormSettings()
		{
			clsShared.cSettings.StoreWindowSettings("ItemList", this);
			clsSettings cSettings = clsShared.cSettings;
			string prefix = "ShowList" + Conversions.ToString((int)eType);
			ListView List = ListItems;
			cSettings.StoreColumnSettings(prefix, ref List);
			ListItems = List;
		}

		private void tsbPrintList_Click(object sender, EventArgs e)
		{
			if (eType == eRecord.eCharacter)
			{
				cPrChar.PrintCharList(cProject);
			}
			else if (eType == eRecord.eLocation)
			{
				cPrLoc.PrintLocationList(cProject);
			}
			else if (eType == eRecord.eItem)
			{
				cPrItem.PrintItemList(cProject);
			}
		}

		private void AddProjectHandlers()
		{
			//Discarded unreachable code: IL_00ec, IL_0103, IL_010e, IL_011e, IL_0164, IL_0166, IL_017a, IL_019c
			int num = default(int);
			int num3 = default(int);
			try
			{
				ProjectData.ClearProjectError();
				num = 2;
				int num2 = 2;
				cProject.AddedNewChar += cProject_Updated;
				num2 = 3;
				cProject.AddedNewItem += cProject_Updated;
				num2 = 4;
				cProject.AddedNewLocation += cProject_Updated;
				num2 = 5;
				cProject.RemovedChar += cProject_Updated;
				num2 = 6;
				cProject.RemovedItem += cProject_Updated;
				num2 = 7;
				cProject.RemovedLocation += cProject_Updated;
				num2 = 8;
				cProject.SavedChar += cProject_Updated;
				num2 = 9;
				cProject.SavedItem += cProject_Updated;
				num2 = 10;
				cProject.SavedLocation += cProject_Updated;
			}
			catch (Exception obj) when ((obj is Exception && num != 0) & (num3 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_019a: Could not find block for branch target IL_0166*/;
			}
			if (num3 != 0)
			{
				ProjectData.ClearProjectError();
			}
		}

		private void cProject_Updated(int ID)
		{
			FillList();
		}

		private void RemoveProjectHandlers()
		{
			//Discarded unreachable code: IL_00ec, IL_0103, IL_010e, IL_011e, IL_0164, IL_0166, IL_017a, IL_019c
			int num = default(int);
			int num3 = default(int);
			try
			{
				ProjectData.ClearProjectError();
				num = 2;
				int num2 = 2;
				cProject.AddedNewChar -= cProject_Updated;
				num2 = 3;
				cProject.AddedNewItem -= cProject_Updated;
				num2 = 4;
				cProject.AddedNewLocation -= cProject_Updated;
				num2 = 5;
				cProject.RemovedChar -= cProject_Updated;
				num2 = 6;
				cProject.RemovedItem -= cProject_Updated;
				num2 = 7;
				cProject.RemovedLocation -= cProject_Updated;
				num2 = 8;
				cProject.SavedChar -= cProject_Updated;
				num2 = 9;
				cProject.SavedItem -= cProject_Updated;
				num2 = 10;
				cProject.SavedLocation -= cProject_Updated;
			}
			catch (Exception obj) when ((obj is Exception && num != 0) & (num3 == 0))
			{
				ProjectData.SetProjectError((Exception)obj);
				/*Error near IL_019a: Could not find block for branch target IL_0166*/;
			}
			if (num3 != 0)
			{
				ProjectData.ClearProjectError();
			}
		}

		private void cPrChar_PrintProgress(string ProgressString)
		{
			tssStatus.Text = ProgressString;
		}

		private void tsbHelp_Click(object sender, EventArgs e)
		{
			Interaction.MsgBox("Drag and drop characters/items/locations to rearrange the order. Note that minor characters are always listed after major ones.");
		}

		private void SortToolStripMenuItem_Click(object sender, EventArgs e)
		{
			if (eType == eRecord.eCharacter)
			{
				if (Interaction.MsgBox("Sort alphabetically? (Major characters will always appear before minor ones)", MsgBoxStyle.YesNo) == MsgBoxResult.Yes)
				{
					cProject.SortCharAlpha();
					FillList();
				}
			}
			else if (eType == eRecord.eLocation)
			{
				cProject.Locations.AlphaSort();
				FillList();
			}
			else if (eType == eRecord.eItem)
			{
				cProject.Items.AlphaSort();
				FillList();
			}
		}

		private void ContextMenuStrip1_Opening(object sender, CancelEventArgs e)
		{
		}

		private void tsbClear_Click(object sender, EventArgs e)
		{
			tsmTB.Clear();
			try
			{
				ListItems.SelectedItems.Clear();
				ListItems.FocusedItem = ListItems.Items[0];
				ListItems.FocusedItem.EnsureVisible();
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}

		private void tsbFind_Click(object sender, EventArgs e)
		{
			try
			{
				bool flag = true;
				int num;
				if (ListItems.FocusedItem == null)
				{
					ListItems.FocusedItem = ListItems.Items[0];
					num = 0;
				}
				else
				{
					num = ListItems.FocusedItem.Index + 1;
				}
				ListItems.SelectedItems.Clear();
				bool flag2 = default(bool);
				while (true)
				{
					int num2 = num;
					int num3 = ListItems.Items.Count - 1;
					for (int i = num2; i <= num3; i++)
					{
						ListViewItem listViewItem = ListItems.Items[i];
						if (listViewItem.Text.ToLower().Contains(tsmTB.Text.ToLower()))
						{
							ListItems.FocusedItem = listViewItem;
							listViewItem.Selected = true;
							listViewItem.EnsureVisible();
							flag2 = true;
							break;
						}
					}
					if (!flag || flag2)
					{
						break;
					}
					flag = false;
					if (num <= 0)
					{
						break;
					}
					ListItems.FocusedItem = ListItems.Items[0];
				}
			}
			catch (Exception ex)
			{
				ProjectData.SetProjectError(ex);
				Exception ex2 = ex;
				ProjectData.ClearProjectError();
			}
		}
	}
}
